<html>
<head>
<title>DWR Reverse Ajax - GPS Tracker Example</title>
<script type="text/javascript" src="../dwr/engine.js"></script>
<!--
Note: replace the key below with your own key, if not serving the page from localhost:8080
-->
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAA_9P3leoajNRw866Ba34-tBTwM0brOpm-All5BF6PoaKBxRWWERQBp4nDkS9za5_7YtEoet0y1AdBIw" type="text/javascript"></script>
</head>

<script type="text/javascript">
var map;
var marker;

window.onload = function() {
  if (GBrowserIsCompatible()) {
    map = new GMap2(document.getElementById("map"));
    map.addControl(new GSmallMapControl());
    map.addControl(new GMapTypeControl());

    var origin = new GLatLng(51.517476, -0.086603);
    map.setCenter(origin, 15);

    marker = new GMarker(origin);
    map.addOverlay(marker);
  }

  dwr.engine.setActiveReverseAjax(true);
}

function updateCoordinate(coord) {
  if (coord) {
    var latLng = new GLatLng(coord.latitude,coord.longitude);
    map.addOverlay(new GPolyline([marker.getPoint(),latLng]));
    marker.setPoint(latLng);
    map.setCenter(latLng);
  }
}
</script>
</head>
<body>
    <div id="map" style="width: 500px; height: 300px"></div>
</body>
